Optimal. Leaf size=102 \[ \frac {(a+b)^3 \log (1-\cos (c+d x))}{2 d}-\frac {b \left (3 a^2+b^2\right ) \log (\cos (c+d x))}{d}-\frac {(a-b)^3 \log (1+\cos (c+d x))}{2 d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3957, 2916, 12,
1816} \begin {gather*} -\frac {b \left (3 a^2+b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a b^2 \sec (c+d x)}{d}-\frac {(a-b)^3 \log (\cos (c+d x)+1)}{2 d}+\frac {(a+b)^3 \log (1-\cos (c+d x))}{2 d}+\frac {b^3 \sec ^2(c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 1816
Rule 2916
Rule 3957
Rubi steps
\begin {align*} \int \csc (c+d x) (a+b \sec (c+d x))^3 \, dx &=-\int (-b-a \cos (c+d x))^3 \csc (c+d x) \sec ^3(c+d x) \, dx\\ &=\frac {a \text {Subst}\left (\int \frac {a^3 (-b+x)^3}{x^3 \left (a^2-x^2\right )} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a^4 \text {Subst}\left (\int \frac {(-b+x)^3}{x^3 \left (a^2-x^2\right )} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a^4 \text {Subst}\left (\int \left (\frac {(a-b)^3}{2 a^4 (a-x)}-\frac {b^3}{a^2 x^3}+\frac {3 b^2}{a^2 x^2}+\frac {b \left (-3 a^2-b^2\right )}{a^4 x}+\frac {(a+b)^3}{2 a^4 (a+x)}\right ) \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {(a+b)^3 \log (1-\cos (c+d x))}{2 d}-\frac {b \left (3 a^2+b^2\right ) \log (\cos (c+d x))}{d}-\frac {(a-b)^3 \log (1+\cos (c+d x))}{2 d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.20, size = 89, normalized size = 0.87 \begin {gather*} \frac {-2 (a-b)^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-2 b \left (3 a^2+b^2\right ) \log (\cos (c+d x))+2 (a+b)^3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 a b^2 \sec (c+d x)+b^3 \sec ^2(c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 92, normalized size = 0.90
method | result | size |
derivativedivides | \(\frac {b^{3} \left (\frac {1}{2 \cos \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+3 b^{2} a \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 b \,a^{2} \ln \left (\tan \left (d x +c \right )\right )+a^{3} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) | \(92\) |
default | \(\frac {b^{3} \left (\frac {1}{2 \cos \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+3 b^{2} a \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 b \,a^{2} \ln \left (\tan \left (d x +c \right )\right )+a^{3} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) | \(92\) |
norman | \(\frac {\frac {6 b^{2} a}{d}-\frac {2 \left (3 b^{2} a -b^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {\left (a^{3}+3 b \,a^{2}+3 b^{2} a +b^{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {b \left (3 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {b \left (3 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(143\) |
risch | \(\frac {2 b^{2} \left (3 a \,{\mathrm e}^{3 i \left (d x +c \right )}+b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 \,{\mathrm e}^{i \left (d x +c \right )} a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b \,a^{2}}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2} a}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{3}}{d}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b \,a^{2}}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2} a}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{3}}{d}-\frac {3 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(261\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 112, normalized size = 1.10 \begin {gather*} -\frac {{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) - {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (\cos \left (d x + c\right ) - 1\right ) + 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \log \left (\cos \left (d x + c\right )\right ) - \frac {6 \, a b^{2} \cos \left (d x + c\right ) + b^{3}}{\cos \left (d x + c\right )^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 7.58, size = 139, normalized size = 1.36 \begin {gather*} \frac {6 \, a b^{2} \cos \left (d x + c\right ) - 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\cos \left (d x + c\right )\right ) - {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + b^{3}}{2 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{3} \csc {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 250 vs.
\(2 (96) = 192\).
time = 0.52, size = 250, normalized size = 2.45 \begin {gather*} \frac {{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {9 \, a^{2} b + 12 \, a b^{2} + 3 \, b^{3} + \frac {18 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {12 \, a b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {9 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.13, size = 85, normalized size = 0.83 \begin {gather*} \frac {\frac {\ln \left (\cos \left (c+d\,x\right )-1\right )\,{\left (a+b\right )}^3}{2}-\frac {\ln \left (\cos \left (c+d\,x\right )+1\right )\,{\left (a-b\right )}^3}{2}+\frac {\frac {b^3}{2}+3\,a\,\cos \left (c+d\,x\right )\,b^2}{{\cos \left (c+d\,x\right )}^2}-\ln \left (\cos \left (c+d\,x\right )\right )\,\left (3\,a^2\,b+b^3\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________